<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
</head>
<body>
<div id="app">
    <el-container>
        <el-header style="background-color: #0aa1ed">
            <p style="float:left;font-size: 18px ;color: #FFFFFF">CollShark商城后台管理系统</p>
            <p style="float:right;color: #FFFFFF">欢迎XXX回来 <a href="">退出登录</a></p>
        </el-header>
        <el-container>
            <el-aside style="width: 200px">
                <el-menu>
                    <el-submenu index="1">
                        <template slot="title">
                            <i class="el-icon-s-flag">分类管理</i>
                        </template>
                        <el-menu-item index="1-1">分类列表</el-menu-item>
                        <el-menu-item index="1-2">添加分类</el-menu-item>
                    </el-submenu>
                </el-menu>
                <el-menu>
                    <el-submenu index="2">
                        <template slot="title">
                            <i class="el-icon-s-">轮播图管理</i>
                        </template>
                        <el-menu-item index="2-1">轮播图列表</el-menu-item>
                        <el-menu-item index="2-2">添加轮播图</el-menu-item>
                    </el-submenu>
                </el-menu>
                <el-menu>
                    <el-submenu index="3">
                        <template slot="title">
                            <i class="el-icon-s-flag">商品管理</i>
                        </template>
                        <el-menu-item index="3-1">商品列表</el-menu-item>
                        <el-menu-item index="3-2">添加商品</el-menu-item>
                    </el-submenu>
                </el-menu>
            </el-aside>
            <el-main>
                <el-table :data="emp">
                    <el-table-column type="index" label="编号"></el-table-column>
                    <el-table-column prop="name" label="分类名称"></el-table-column>
                    <el-table-column label="操作">
                        <template slot-scope="scope">
                            <el-button size="mini" type="danger"
                                       @click="handleDelete(scope.$index,scope.row)">删除
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-main>
        </el-container>
    </el-container>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue@2/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
    let v = new Vue({
        el: '#app',
        data: function () {
            return {
                emp: [{name: "精彩活动"},
                    , {name: "精品女装"},
                    {name: "时尚男装"},
                    {name: "医疗健康"},
                    , {name: "数码科技"}],
                arr: []
            }
        },
        methods: {
            handleDelete(i, emp) {
                if (confirm("您确定删除吗" + emp.name + "吗?")) {
                    v.arr.splice(i, 1);
                    v.$message.success("删除成功!");
                }
            }

        }
    })
</script>
</html>